/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author 7P7
 */
@Entity
@Table(name = "Prize", catalog = "NationalLevelPaperPresentation", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Prize.findAll", query = "SELECT p FROM Prize p"),
    @NamedQuery(name = "Prize.findByPrizeID", query = "SELECT p FROM Prize p WHERE p.prizeID = :prizeID"),
    @NamedQuery(name = "Prize.findByPrizeValue", query = "SELECT p FROM Prize p WHERE p.prizeValue = :prizeValue"),
    @NamedQuery(name = "Prize.findByAwarded", query = "SELECT p FROM Prize p WHERE p.awarded = :awarded"),
    @NamedQuery(name = "Prize.findByAwardDate", query = "SELECT p FROM Prize p WHERE p.awardDate = :awardDate")})
public class Prize implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "PrizeID", nullable = false)
    private Integer prizeID;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PrizeValue", precision = 10, scale = 2)
    private BigDecimal prizeValue;
    @Column(name = "Awarded")
    private Boolean awarded;
    @Column(name = "AwardDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date awardDate;
    @JoinColumn(name = "StudentID", referencedColumnName = "StudentID")
    @ManyToOne
    private Student studentID;
    @JoinColumn(name = "PrizeCateID", referencedColumnName = "PrizeCateID")
    @ManyToOne
    private PrizeCategory prizeCateID;
    @JoinColumn(name = "EventID", referencedColumnName = "EventID")
    @ManyToOne
    private Event eventID;

    public Prize() {
    }

    public Prize(Integer prizeID) {
        this.prizeID = prizeID;
    }

    public Integer getPrizeID() {
        return prizeID;
    }

    public void setPrizeID(Integer prizeID) {
        this.prizeID = prizeID;
    }

    public BigDecimal getPrizeValue() {
        return prizeValue;
    }

    public void setPrizeValue(BigDecimal prizeValue) {
        this.prizeValue = prizeValue;
    }

    public Boolean getAwarded() {
        return awarded;
    }

    public void setAwarded(Boolean awarded) {
        this.awarded = awarded;
    }

    public Date getAwardDate() {
        return awardDate;
    }

    public void setAwardDate(Date awardDate) {
        this.awardDate = awardDate;
    }

    public Student getStudentID() {
        return studentID;
    }

    public void setStudentID(Student studentID) {
        this.studentID = studentID;
    }

    public PrizeCategory getPrizeCateID() {
        return prizeCateID;
    }

    public void setPrizeCateID(PrizeCategory prizeCateID) {
        this.prizeCateID = prizeCateID;
    }

    public Event getEventID() {
        return eventID;
    }

    public void setEventID(Event eventID) {
        this.eventID = eventID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (prizeID != null ? prizeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Prize)) {
            return false;
        }
        Prize other = (Prize) object;
        if ((this.prizeID == null && other.prizeID != null) || (this.prizeID != null && !this.prizeID.equals(other.prizeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Prize[ prizeID=" + prizeID + " ]";
    }
    
}
